FROM php:8.0-apache AS build
WORKDIR /
RUN apt-get update && apt-get -y install wget unzip
RUN wget https://static.kodcloud.com/update/download/kodbox.1.26.zip \
    && unzip -n kodbox.1.26.zip -d /var/www/html/ \
    && chmod -R 777 /var/www/html/

FROM php:8.0-apache AS final
WORKDIR /var/www/html/
COPY --from=build /var/www/html/ /var/www/html/

# 定义环境变量，设置时区时使用
ENV TIME_ZONE Asia/Shanghai

# COPY src/ /var/www/html/

RUN cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
    && apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev \
    && docker-php-ext-configure gd --with-freetype --with-jpeg \
    && docker-php-ext-install -j$(nproc) gd \
    # && docker-php-ext-install pdo pdo_mysql \
    # && echo "extension=pdo_mysql.so" >> "$PHP_INI_DIR/docker-php-ext-pdo_msql.ini" \
    && chmod -R 777 /var/www/html/











# # docker push tfs.weberp.com.cn/mydocker/php/kodbox:latest